from pydantic import BaseModel, ConfigDict

from core.data_types import DatetimeStr, DateStr


class Version(BaseModel):
    name: str
    start_time: DateStr | None = None
    end_time: DateStr | None = None
    order: int
    disabled: bool | None = False
    desc: str | None = None


class VersionSimpleOut(Version):
    model_config = ConfigDict(from_attributes=True)

    id: int
    create_time: DatetimeStr
    update_time: DatetimeStr
